//
//  ExploreCollectionCell.m
//  XPhoto
//
//  Created by baboy on 2019/8/28.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "ExploreCollectionCell.h"
#import <AFNetworking/UIButton+AFNetworking.h>

@implementation ExploreCollectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setPost:(Post *)post{
    _post = post;
    PostItem *postItem = post.items.firstObject;
    [self.imageButton setImageForState:UIControlStateNormal withURL:[NSURL URLWithString:postItem.thumb?:postItem.url]];
}
- (IBAction)clickImage:(id)sender{
    if (self.delegate && [self.delegate respondsToSelector:@selector(exploreCollectionCellDidClickedImage:)]) {
        [self.delegate exploreCollectionCellDidClickedImage:self];
    }
}
@end
